<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>javascript</title>
    <script>
      // 声明变量
      let var1 = "var1";
      console.log(var1);

      // 变量类型(动态类型)
      // Array 是 Object类型

      // Number
      let age = 10;

      // String
      let name = "dong";

      // Boolean
      let isExit = true;

      // String Array
      let users = ["dong", "xixi", "nan"];

      // Number Array
      let ages1 = [1, 2, 3, 4];
      console.log(ages1);

      // Other Array
      let ages2 = [1, "1", 3, 4];
      console.log(ages2[1]); // 数组通过下标获取值

      // Object
      let obj = { name: "dong", age: 10 };
      console.log(obj);

      // null
      let nl = null;
      console.log(nl);

      // undefined
      let ud = undefined;

      // NAN
      let nan = undefined + 1;
      console.log(nan);

      // 对象通过属性获取值
      console.log(obj.name);

      // 获取变量类型
      console.log(typeof age);
    </script>
  </head>
</html>
